import http from '../utils/request'

//通过userid获取用户信息
export const GetUserInfo = params => {
  return http.request({
    url: `/house/mini/user/GetUserInfo`,
    method: 'get',
    params
  })
}
//通过openid获取用户信息
export const GetUserInfo_openid = params => {
  return http.request({
    url: `/house/mini/user/GetUserInfo_openid`,
    method: 'get',
    params
  })
}
//小程序获取手机号
export const getTelphone = params => {
  return http.request({
    url: `/house/mini/user/getTelphone`,
    method: 'get',
    params
  })
}
//注册
export const Reguser = data => {
  return http.request({
    url: `/house/mini/user/Reguser`,
    method: 'post',
    data: JSON.stringify(data)
  })
}
//修改个人信息
export const UpdateHousetuser = data => {
  return http.request({
    url: `/house/mini/user/UpdateHousetuser`,
    method: 'post',
    data: JSON.stringify(data)
  })
}
//通过code获取openid和unionid和session_key
export const getuseropenid = params => {
  return http.request({
    url: `/house/mini/user/getuseropenid`,
    method: 'get',
    params
  })
}
// 老板账号登陆
export const bossLogin = data => {
  return http.request({
    url: `/house/mini/user/userbosslogin`,
    method: 'post',
    data: JSON.stringify(data)
  })
}
//首页身份选择
export const ChangeUserType = params => {
  return http.request({
    url: `/house/mini/user/ChangeUserType`,
    method: 'get',
    params
  })
}
//首页身份选择
export const Createrealname = data => {
  return http.request({
    url: `/house/pay/Createrealname`,
    method: 'POST',
    data
  })
}

//
export const createPayment = data => {
  return http.request({
    url: `/house/pay/createPayment`,
    method: 'POST',
    data
  })
}

export const GetUnreadCount = params => {
  return http.request({
    url: `/house/tAppointment/GetUnreadCount`,
    method: 'get',
    params
  })
}

export const GetthealName = params => {
  return http.request({
    url: `/house/mini/user/GetTRealname`,
    method: 'get',
    params
  })
}

export const gettoken = data => {
  return http.request({
    url: `/house/comm/gettoken`,
    method: 'POST',
    data
  })
}
